﻿using System;
using Autofac;
using Hyt.Core;
using Hyt.Passport.Persist;
using System.Reflection;

namespace Hyt.Passport.Service
{
    public abstract class IocSetting : IIocSetting
    {
        public  void Register(ContainerBuilder builder, IUnitOfWork unitOfWork)
        {
            RegisterAllService(builder);
        }

        public virtual void RegisterAllService(ContainerBuilder builder)
        {
            builder.RegisterAssemblyTypes(Assembly.GetExecutingAssembly()).Where(t => t.Name.EndsWith("Service")).PropertiesAutowired();
        }

    }
}
